package com.bristua.mall.user.controller;

import com.bristua.mall.common.bean.Result;
import com.bristua.mall.common.utils.HandleResultUtil;
import com.bristua.mall.user.biz.AddUserCollectionGoodsBiz;
import com.bristua.mall.user.enums.UserCode;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Administrator on 2019/3/25.
 */
@RestController
@Api(value="商品收藏",tags={"商品收藏"})
public class UserCollectionGoodsController {

    @Autowired
    private AddUserCollectionGoodsBiz addUserCollectionGoodsBiz;
    @ApiOperation(value="商品收藏")
    @PostMapping(value="/api/user/add/goods/collection/{goodsId}")
    public Result userCollectionGoods(@PathVariable(value = "goodsId")String goodsId){
        addUserCollectionGoodsBiz.addUserCollectionGoods(goodsId);
        return HandleResultUtil.commonResult(UserCode.COLLECTION_GOODS_SUCCESS.getCode(),UserCode.COLLECTION_GOODS_SUCCESS.getMsg());
    }
}
